<?php

namespace App\Api\Controllers;

use App\Models\Crousesheet;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use DB;
use Encore\Admin\Facades\Admin;

class GetChargemanBySmallCampController extends Controller
{
    public function get_chargeman_by_small_camp(Request $request)
    {
        $small_camp_id = $request->get('q');
        return DB::table('kly_students as ks')->leftjoin('students as s',function($join){
            $join->on('ks.student_id','=','s.id');
        })->where('ks.small_camp_id',$small_camp_id)->where('camp_group_id',0)->get(['s.id', DB::raw('s.en_name as text')]);
    }
}
